﻿using System;
using DnEcuDiag.Ecus.Enums;
using DnEcuDiag.Ecus.Generic;
using DnEcuDiag.Ecus.Kwp;
using DnEcuDiag.Factories;
using NUnit.Framework;

namespace DnEcuDiag.Tests
{
    [TestFixture]
    public class ME731Tests
    {
        private KwpEcu _ecu;
        private KwpTestDevice _device;

        [TestFixtureSetUp]
        public void TestSetup()
        {
            _device = new KwpTestDevice();

            EcuDescriptor descriptor = EcuFactory.EcuList.Find(ecuDescriptor => ecuDescriptor.Name == "Bosch Motronic ME7.3.1");

            _ecu = EcuFactory.CreateEcu(descriptor) as KwpEcu;
            Assert.IsNotNull(_ecu);
            _ecu.DiagnosticInterface = _device;
            _ecu.Connect();
        }

        [Test]
        public void TestFaults()
        {
            Assert.AreNotEqual(0, _ecu.ErrorMemoryStructureDefinition.ErrorDefinitions.Count, "ErrorMemoryStructureDefinition.Count == 0 for ME.7.3.1");
            Assert.AreEqual(102, _ecu.ErrorMemoryStructureDefinition.ErrorDefinitions.Count, "ErrorMemoryStructureDefinition.Count != 37 for ME.7.3.1");

            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // Three P0100
            //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////			
            _device.FaultcodeList = new byte[] { 0x58, 03, 01, 00, 0xE2, 01, 00, 0xE2, 01, 00, 0xE2 };
            _device.Faultcodeinfo = new byte[]{
												   0x57, 0x3, 
												   0x01, 0x00, 
												   0xE2, 0x1D, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x40,
												   0x01, 0x00, 
												   0xE2, 0x1D, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x40,
												   0x01, 0x00, 
												   0xE2, 0x1D, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x40
											   };

            _ecu.ReadFaultCodes();

            Assert.AreEqual(3, _ecu.ActiveFaultCodes.Count, "ActiveFaultCodes.Count == 3 for ME7.3.1");
            Console.WriteLine(_ecu.ActiveFaultCodes[0].FaultDescription);
            Assert.AreEqual("P0100", (_ecu.ActiveFaultCodes[0]).FaultComponent);
            Assert.AreEqual(
                "Failed Component Code: Air Flow Meter\r\n" +
                "Fault Symptom: Below Minimum Limit\r\n" +
                "Warning Lamp Status: Warning Lamp Illuminated\r\n" +
                "Fault Test State: Test complete for this Error or not applicable.\r\n" +
                "Fault Code Storage State: Error Present at time of request\r\n" +
                "Event Count: 64 count\r\n" +
                "Environmental Condition One: Engine Speed: 1160 rpm\r\n" +
                "Environmental Condition Two: Relative Load: 9.75 %\r\n" +
                "Environmental Condition Three: Engine Coolant Temperature: -48 °C\r\n" +
                "Environmental Condition Four: Air Temperature: -48 °C\r\n" +
                "Environmental Condition Five: Throttle Valve Angle: 0 °\r\n" +
                "Environmental Condition Six: Battery Voltage: 0 volts\r\n",
                _ecu.ActiveFaultCodes[0].FaultDescription);

            _device.FaultcodeList = new byte[] { 0x58, 01, 01, 0x59, 0xE2 };
            _device.Faultcodeinfo = new byte[]{
												   0x57, 0x1, 
												   0x01, 0x59, 
												   0xE2, 10, 10, 10, 10, 0xFF, 10, 0x40
											   };

            _ecu.ReadFaultCodes();

            Assert.AreEqual(1, _ecu.ActiveFaultCodes.Count, "ActiveFaultCodes.Count == 1 for ME7.3.1");
            Console.WriteLine(_ecu.ActiveFaultCodes[0].FaultDescription);
            Assert.AreEqual("P0159", (_ecu.ActiveFaultCodes[0]).FaultComponent);
            Assert.AreEqual(
                "Failed Component Code: Lambda Sensor Bank 2 Slow Response (Post Cat)\r\n" +
                "Fault Symptom: Below Minimum Limit\r\n" +
                "Warning Lamp Status: Warning Lamp Illuminated\r\n" +
                "Fault Test State: Test complete for this Error or not applicable.\r\n" +
                "Fault Code Storage State: Error Present at time of request\r\n" +
                "Event Count: 64 count\r\n" +
                "Environmental Condition One: Engine Speed: 400 rpm\r\n" +
                "Environmental Condition Two: Relative Load: 7.5 %\r\n" +
                "Environmental Condition Three: Engine Coolant Temperature: -40.5 °C\r\n" +
                "Environmental Condition Four: Air Temperature: -40.5 °C\r\n" +
                "Environmental Condition Five: Throttle Valve Angle: 100 °\r\n" +
                "Environmental Condition Six: Battery Voltage: 0.72 volts\r\n",
                _ecu.ActiveFaultCodes[0].FaultDescription);

            _device.FaultcodeList = new byte[] { 0x58, 01, 03, 0x01, 0xE2 };
            _device.Faultcodeinfo = new byte[]{
												   0x57, 0x1, 
												   0x03, 0x01, 
												   0xE2, 10, 10, 10, 0xFF, 0xFF, 10, 0x40
											   };

            _ecu.ReadFaultCodes();

            Assert.AreEqual(1, _ecu.ActiveFaultCodes.Count, "ActiveFaultCodes.Count == 1 for ME7.3.1");
            Console.WriteLine(_ecu.ActiveFaultCodes[0].FaultDescription);
            Assert.AreEqual("P0301", (_ecu.ActiveFaultCodes[0]).FaultComponent);
            Assert.AreEqual(
                "Failed Component Code: Cylinder 1 Misfire Detected\r\n" +
                "Fault Symptom: Continous (Increased Emissions)\r\n" +
                "Warning Lamp Status: Warning Lamp Illuminated\r\n" +
                "Fault Test State: Test complete for this Error or not applicable.\r\n" +
                "Fault Code Storage State: Error Present at time of request\r\n" +
                "Event Count: 64 count\r\n" +
                "Environmental Condition One: Engine Speed: 400 rpm\r\n" +
                "Environmental Condition Two: Relative Load: 7.5 %\r\n" +
                "Environmental Condition Three: Engine Coolant Temperature: -40.5 °C\r\n" +
                "Environmental Condition Four: Status of Fuel Level: Not Empty\r\n" +
                "Environmental Condition Five: Throttle Valve Angle: 100 °\r\n" +
                "Environmental Condition Six: Battery Voltage: 0.72 volts\r\n",
                _ecu.ActiveFaultCodes[0].FaultDescription);

            _device.FaultcodeList = new byte[] { 0x58, 01, 03, 0x01, 0xE2 };
            _device.Faultcodeinfo = new byte[]{
												   0x57, 0x1, 
												   0x03, 0x01, 
												   0xE2, 10, 10, 10, 0, 0xFF, 10, 0x40
											   };

            _ecu.ReadFaultCodes();

            Assert.AreEqual(1, _ecu.ActiveFaultCodes.Count, "ActiveFaultCodes.Count == 1 for ME7.3.1");
            Console.WriteLine(_ecu.ActiveFaultCodes[0].FaultDescription);
            Assert.AreEqual("P0301", (_ecu.ActiveFaultCodes[0]).FaultComponent);
            Assert.AreEqual(
                "Failed Component Code: Cylinder 1 Misfire Detected\r\n" +
                "Fault Symptom: Continous (Increased Emissions)\r\n" +
                "Warning Lamp Status: Warning Lamp Illuminated\r\n" +
                "Fault Test State: Test complete for this Error or not applicable.\r\n" +
                "Fault Code Storage State: Error Present at time of request\r\n" +
                "Event Count: 64 count\r\n" +
                "Environmental Condition One: Engine Speed: 400 rpm\r\n" +
                "Environmental Condition Two: Relative Load: 7.5 %\r\n" +
                "Environmental Condition Three: Engine Coolant Temperature: -40.5 °C\r\n" +
                "Environmental Condition Four: Status of Fuel Level: Empty\r\n" +
                "Environmental Condition Five: Throttle Valve Angle: 100 °\r\n" +
                "Environmental Condition Six: Battery Voltage: 0.72 volts\r\n",
                _ecu.ActiveFaultCodes[0].FaultDescription);

            _device.FaultcodeList = new byte[] { 0x58, 01, 0xD6, 0x00, 0xE2 };
            _device.Faultcodeinfo = new byte[]{
												   0x57, 0x1, 
												   0xD6, 0x00, 
												   0xE8, 10, 10, 10, 4, 0xFF, 10, 0x40
											   };

            _ecu.ReadFaultCodes();

            Assert.AreEqual(1, _ecu.ActiveFaultCodes.Count, "ActiveFaultCodes.Count == 1 for ME7.3.1");
            Console.WriteLine(_ecu.ActiveFaultCodes[0].FaultDescription);
            Assert.AreEqual("U1600", (_ecu.ActiveFaultCodes[0]).FaultComponent);
            Assert.AreEqual(
                "Failed Component Code: Immobiliser\r\n" +
                "Fault Symptom: Signal Not Valid\r\n" +
                "Warning Lamp Status: Warning Lamp Illuminated\r\n" +
                "Fault Test State: Test complete for this Error or not applicable.\r\n" +
                "Fault Code Storage State: Error Present at time of request\r\n" +
                "Event Count: 64 count\r\n" +
                "Environmental Condition One: Engine Speed: 400 rpm\r\n" +
                "Environmental Condition Two: Relative Load: 7.5 %\r\n" +
                "Environmental Condition Three: Engine Coolant Temperature: -40.5 °C\r\n" +
                "Environmental Condition Four: Immobiliser: Code received\r\n" +
                "Environmental Condition Four: Immobiliser: Key code ok\r\n" +
                "Environmental Condition Four: Immobiliser: Virgin Ecu\r\n" +
                "Environmental Condition Four: Immobiliser: Engine start enabled\r\n" +
                "Environmental Condition Four: Immobiliser: Universal code not received\r\n" +
                "Environmental Condition Four: Immobiliser: Separate line used not used\r\n" +
                "Environmental Condition Four: Immobiliser: EEPROM ok\r\n" +
                "Environmental Condition Five: Throttle Valve Angle: 100 °\r\n" +
                "Environmental Condition Six: Battery Voltage: 0.72 volts\r\n",
                _ecu.ActiveFaultCodes[0].FaultDescription);
        }

        [Test]
        public void TestSensor()
        {
            Assert.AreEqual(139, _ecu.Sensors.Count);

            TestSensorValues();
        }

        private void TestSensorValues()
        {
            TimeStampedMeasurement tsm;
            int i = 0;
            LocalIdentifier li = _ecu.Sensors[i] as LocalIdentifier;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 01 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 02 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 04 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 08 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x10 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x20 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x40 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x80 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.1f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 40, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            i++;


            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.1f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.25f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 * 0.75) - 48, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 * 0.75) - 48, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.1f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(BitConverter.ToInt16(new byte[] { 0x1, 0x0 }, 0) * 0.75, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x8F, 0xFF };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(BitConverter.ToInt16(new byte[] { 0xFF, 0x8F }, 0) * 0.75, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0xFF, 0xFF };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(BitConverter.ToInt16(new byte[] { 0xFF, 0xFF }, 0) * 0.75, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 / 75f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.75 / 32, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0xFF, 0xFF };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(-0.0244f, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x8F, 0xFF };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(-699.6212f, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(0.0244f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.1f, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 01 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x02 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x04 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x08 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x10 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x20 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x40 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x80 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x01, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x02, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x04, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("True", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("False", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x20, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Signaled", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Not Signaled", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0723f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.00781f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0048828125f - 1, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0048828125f - 1, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0048828125f - 1, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0048828125f - 1, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 10, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 256, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 / 375f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 5f / 1024, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0xFF, 0xFF };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(0xffff * 5f / 1024, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 5f / 1024, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.00152f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 2f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0468f, tsm.Measurement);

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0xFF, 0xFF };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(BitConverter.ToInt16(new byte[] { 0xff, 0xff }, 0) * 0.0468f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 0.0468f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 0.0468f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 0.0468f, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("0: Learning (New Ecu)", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 01 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("1: Learning (New Ecu)", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 02 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("2: Learning (New Ecu)", tsm.Status);
            Assert.AreEqual(2, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 03 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("3: Learning (New Ecu)", tsm.Status);
            Assert.AreEqual(3, tsm.Measurement);


            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 04 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("4: Learning", tsm.Status);
            Assert.AreEqual(4, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 05 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("5: Learning", tsm.Status);
            Assert.AreEqual(5, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 06 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("6: Learning", tsm.Status);
            Assert.AreEqual(6, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 07 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("7: Learning", tsm.Status);
            Assert.AreEqual(7, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 08 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("8: Learning", tsm.Status);
            Assert.AreEqual(8, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 09 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("9: Learning", tsm.Status);
            Assert.AreEqual(9, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0xA };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("10: Learning", tsm.Status);
            Assert.AreEqual(10, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0xB };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("11: Learning Complete", tsm.Status);
            Assert.AreEqual(11, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Neutral", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 01 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("First", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 02 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Second", tsm.Status);
            Assert.AreEqual(2, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 03 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Third", tsm.Status);
            Assert.AreEqual(3, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 04 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Fourth", tsm.Status);
            Assert.AreEqual(4, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 05 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Fifth", tsm.Status);
            Assert.AreEqual(5, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 06 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Sixth", tsm.Status);
            Assert.AreEqual(6, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 07 };
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Reverse", tsm.Status);
            Assert.AreEqual(7, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 100f / 32768, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0F, 0xFF };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(BitConverter.ToInt16(new byte[] { 0xFF, 0x0F }, 0) * 100f / 32768, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 4f / 65536, tsm.Measurement);

            i++;
            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 10f / 256, tsm.Measurement);

            i++;
            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 10f / 256, tsm.Measurement);

            i++;
            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.0039f, tsm.Measurement);

            i++;
            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 16f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 16f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 * 5) - 50, tsm.Measurement);

            i++;


            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 * 5) - 50, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.75f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.1f, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 200f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 100f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 * 5) - 50, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 100f / 32768, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 100f / 32768, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 100f / 32768, tsm.Measurement);

            i++;
            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 64f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 0.75 - 48, tsm.Measurement);



            i++;


            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 - 0) * 128f / 65536, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 0.1f, tsm.Measurement);

            i++;


            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 01 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Long", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Short", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0xFF };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Long", tsm.Status);
            Assert.AreEqual(0xFF, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual((1 * 5) - 50, tsm.Measurement);

            i++;

            li = _ecu.Sensors[i] as LocalIdentifier;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x1 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual(string.Empty, tsm.Status);
            Assert.AreEqual(1 * 1530 / 255, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 01 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 02 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 04 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;
            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 08 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x10 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x20 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x40 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Pressed", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Not Pressed", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;


            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 0x80 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Pressed", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Not Pressed", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x01, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x02, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x04, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x08, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Started", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Not Started", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x10, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("At Minimum", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Above Minimum", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x40, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x80, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Satisfied", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Not Satisfied", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x01 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Closed Loop", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Open Loop", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x02 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Closed Loop", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Open Loop", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x04 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x08 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Closed Loop", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Open Loop", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x10 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Closed Loop", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Open Loop", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x20 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x40 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x80 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Present", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Absent", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x01, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Present", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Absent", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x2, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Present", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Absent", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x4, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Present", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Absent", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x10, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Present", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Absent", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x20, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Motor Off", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Motor On", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x01 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x02 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Succeded", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Failed", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x04 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Enabled", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Disabled", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x08 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Completed", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InComplete", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x10 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Prohibited", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Allowed", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x20 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Not Plausible", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Ok", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x40 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x0, 0x80 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x01, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x02, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Interrupted", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Ok", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x04, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Active", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("InActive", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x08, 0x0 };

            Console.WriteLine(string.Format("Testing Sensor: [{0}] {1}", i, _ecu.Sensors[i].Name));
            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("On", tsm.Status);
            Assert.AreEqual(1, tsm.Measurement);

            _device.LocalidentifierData = new byte[] { 0x61, (Byte)li.Id, 0x00, 00 };

            tsm = _ecu.ReadSensor(_ecu.Sensors[i]);
            Assert.AreEqual("Off", tsm.Status);
            Assert.AreEqual(0, tsm.Measurement);

            i++;
        }

        [TestFixtureTearDown]
        public void Dispose()
        {
            if (_ecu != null)
            {
                _ecu.Close();
                _ecu.Dispose();
            }
            _ecu = null;
        }
    }
}
